﻿<%@ Page Language="VB"%>
<%@ Register TagPrefix="IRL" TagName="SideBar" Src="SideBar.ascx" %>
<%@ Import Namespace="IRL.Utilities" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>

<script runat="server">
    Public Const CURRENT_MODULE As Integer = 1
    Dim ptype_lookup As Hashtable, rcat_lookup As Hashtable
    Dim menu_structure As StringBuilder
    
    Private Sub Page_Load(ByVal Sender As Object, ByVal E As EventArgs)
        Dim SysAcc = New IRL.Utilities.Security(CURRENT_MODULE)
        
        SysAcc.Authenticate()
        InitLookUp()
        SideBar1.loadData()
        If Not Page.IsPostBack Then
            grid1.Attributes.Add("sortFld", "")
            grid1.Attributes.Add("sortDir", "")
            searchProject()
        End If
        
    End Sub
    
    Private Sub InitLookUp()
        Dim connStr As Object = ConfigurationSettings.AppSettings("sqlConn")
        Dim conn As SqlConnection = New SqlConnection(connStr.ToString())
        
        With conn
            ptype_lookup = Lookup.Fill("sp_Select_cms_Lookup 'project_type'", conn)
            rcat_lookup = Lookup.Fill("sp_Select_cms_Lookup 'research_category_s'", conn)
        End With
        
    End Sub
    
    Private Sub rebind()
        
    End Sub
    
    Private Sub searchProject()
        
    End Sub
    
    Private Sub grid1_ItemDataBound(ByVal Sender As Object, ByVal e As DataGridItemEventArgs)
        
    End Sub
    
    Private Sub grid1_SortCommand(ByVal Sender As Object, ByVal e As DataGridItemEventArgs)
        
    End Sub
    
    
    
</script>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

    <title>Indochina Research</title>
    <link rel="SHORTCUT ICON" href="../irl.ico" type="image/x-icon" />
    <link type="text/css" rel="stylesheet" href="../css/global.css" />
    
    <link type="text/css" rel="stylesheet" href="../css/dropdown_menu.css" />
	<script language="javascript" src="includes/dropdown.js"></script>

</head>

<body>
<table width="773" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr>
		<td width="765" height="540" align="center" valign="top" style="border:solid 1px #10147e;" >
			<!-- header -->
			<table border="0" cellpadding="0" cellspacing="0" width="100%">
				<tr bgcolor="#F4F4F9">
					<td colspan="3" align="right" style="padding:10px;">
						<b class="blueL">Client Management System</b>
					</td>
				</tr>
				<tr>
					<td class="wave_l">&nbsp;</td>
					<td><img src="images/wave_logo.jpg" width="107" height="83"></td>
					<td class="wave_r">&nbsp;</td>
				</tr>
				<tr>
					<td colspan="3" style="padding:0 20px;">
						<div style="background-color:#bcb3d5; padding:5px 10px;">
							<span style="float:right">

								&nbsp;</span>
							<span class="pathmap">
								<a href="default.aspx" >CPanel</a> :: Ops Files
						  </span>
						</div>
						<br />
						
						
					</td>
				</tr>
				
			</table>
			
			<!-- body -->
			<form id="SearchForm" method="post" runat="server">
			<table border="0" width="100%" cellspacing="0" cellpadding="0">
				<tr>
					<td align="center" valign="top" style="padding-left:20px;">
						<table align="left" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td valign="top">
									<IRL:SideBar ID="SideBar1" runat="server" />
								</td>
								<td width="10"><img src="images/spacer.gif" width="10" height="1" /></td>
								<td valign="top">
									<!-- data row -->
                                    <div style="width:480px; overflow:auto; overflow-y:visible">
                                        <asp:DataGrid CssClass="data" ID="grid1" Width="100%" runat="server" CellSpacing="1" CellPadding="4"
                                            
                                            >
                                            <HeaderStyle CssClass="header" />
                                            <ItemStyle BackColor="#efefef" />
                                            <AlternatingItemStyle BackColor="white" />
                                            <Columns>
                                                <asp:BoundColumn DataField="ProposalID" Visible="false" />
                                                <asp:BoundColumn DataField="ClientID" Visible="false" />
                                                <asp:BoundColumn DataField="Status" Visible="false" />
                                                
                                                <asp:BoundColumn HeaderText="ClientName" DataField="ClientName" SortExpression="ClientName">
                                                    <HeaderStyle Width="180" />
                                                </asp:BoundColumn>
                                                
                                                <asp:TemplateColumn HeaderText="Project Name">
                                                    <HeaderStyle Width="180" />
                                                    <ItemTemplate>
                                                        
                                                        
                                                        
                                                    </ItemTemplate>
                                                </asp:TemplateColumn>
                                                
                                                <asp:BoundColumn HeaderText="Value" DataField="Costs" DataFormatString="{0:$#}" SortExpression="Costs">
                                                    <HeaderStyle Width="50" />
                                                </asp:BoundColumn>
                                                
                                                <asp:TemplateColumn HeaderText="Type" SortExpression="ProjectType">
                                                    <HeaderStyle Width="25" />
                                                    <ItemTemplate>
                                                        <%# ptype_lookup(DataBinder.Eval(Container.DataItem, "ProjectType").ToString())%>
                                                    </ItemTemplate>
                                                </asp:TemplateColumn>
                                                
                                                <asp:TemplateColumn HeaderText="Sector" SortExpression="ResearchCategory">
                                                    <HeaderStyle Width="25" />
                                                    <ItemTemplate>
                                                        <%# rcat_lookup(DataBinder.Eval(Container.DataItem, "ResearchCategory").ToString())%>
                                                    </ItemTemplate>
                                                </asp:TemplateColumn>
                                                
                                            </Columns>
                                        </asp:DataGrid>
                                    </div>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
			</form>
			
		</td>
		
		<td width="6" class="rightShadow" valign="top">
			<img src="images/white.gif" width="6" height="6" /></td>
	</tr>
	
	<!-- bottom shadow -->
	<tr>
		<td height="6" class="bottomShadow">
			<img src="images/white.gif" width="6" height="6" /></td>
		
		<td width="6" height="6">
			<img src="images/shadow_corner.gif" width="6" height="6" /></td>
	</tr>
</table>


</body>
</html>
